<template>

	<view class="cF">
		<view class="ticket-details mainpadding mainbgc">
			<view class="mainpadding ffffff border-r1 margin-top" v-for="(item) in dataAll.goods">
				<view class="add">{{item.tour_name}}</view>
				<view class="margin-top minute-box">
					<view class="img border-r2 margin-right">
						<image :src="item.images_text" mode=""></image>
					</view>
					<view class="minute flex1">
						<view class="">{{item.tour_ticket_name}}</view>
						<view class="pAc flexleft2">
							<text class="tMoney">￥{{item.total_price}}</text>
							<text class="tCount">x{{item.total_num}}</text>
						</view>
					</view>
				</view>
			</view>
			<!-- 订单详细信息：-->
			<view class="detailInfo mainpadding margin-top ffffff border-r1">
				<view class="flexleft2">
					<view class="it2">订单编号</view>
					<view class="it">{{dataAll.order_no}}</view>
				</view>
				<view class="flexleft2 margin-top">
					<view class="it2">联系人</view>
					<view class="it">{{dataAll.username}}</view>
				</view>
				<view class="flexleft2 margin-top">
					<view class="it2">联系电话</view>
					<view class="it">{{dataAll.mobile}}</view>
				</view>
				<view class="flexleft2 margin-top">
					<view class="it2">创建时间</view>
					<view class="it">{{dataAll.createtime_text}}</view>
				</view>
			</view>
		</view>
		<view class="mainpadding buyBtn">
			<view class="btnbottom" @click="hexiao">确认核销</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid: "",
				dataAll: {},
				tour_order_id:0
			}
		},
		onLoad(optios) {
			let _this = this
			// #ifdef MP-WEIXIN
			const url = decodeURIComponent(optios.q) // 获取到二维码原始链接内容
			if (url.indexOf("?") != -1) {
				var str = url.substr(url.indexOf("?") + 1);
				var strs = str.split("&");
				let theRequest = {};
				for (var i = 0; i < strs.length; i++) {
					theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
				}
				_this.tour_order_id = optios.tour_order_id ? optios.tour_order_id : (theRequest.tour_order_id ? theRequest.tour_order_id :
					0);
			}
			// #endif
			
			_this.init()
		},
		methods: {
			init() {
				let _this = this;
				httpRequest.request('api/tourorder/hxDetail', 'GET', {
					id: this.tour_order_id,
				}, false, false, true).then(res => {
					if (res.code == 1) {
						this.dataAll = res.data
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			hexiao(){
				if (!httpRequest.checkIsLogin()) {
					httpRequest.doLogin();
					return false;
				}
				httpRequest.request('api/tourorder/hxOrder', 'GET', {
					id: this.tour_order_id,
				}, false, false, true).then(res => {
					httpRequest.toast(res.msg)
					if (res.code == 1) {
						setTimeout(()=>{
							uni.reLaunch({
								url:"/pages/hotel/jiudian"
							})
						},500)
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.buyBtn {
		position: fixed;
		bottom: 30rpx;
		left: 0;
		box-sizing: border-box;
		width: 100%;
	}
	.btnbottom{
		width: 100%;
		background-color: pink;
		text-align: center;
		padding: 18rpx 0;
		background-color: #FF5C00;
		color: #fff;
		border-radius: 64rpx;
	}
	.cF {
		// overflow: hidden;
	}
	
	.ticketDetailsTitle {
		font-size: 34rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #333333;
	}
	
	.surplusTime {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #333333;
		margin-top: 7rpx;
	}
	
	.name {
		font-size: 30rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #000000;
	}
	
	.address {
		font-size: 28rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 500;
		color: #666666;
		margin-top: 7rpx;
	}
	
	.add {
		font-size: 28rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #333333;
	}
	
	.minute-box {
		display: flex;
	}
	
	.img {
		width: 124rpx;
		height: 124rpx;
	
		image {
			width: 100%;
			height: 100%;
		}
	}
	
	.pAc {
		margin-top: 50rpx;
	}
	
	.tMoney {
		font-size: 30rpx;
		font-family: DIN Next LT Pro-Bold, DIN Next LT Pro;
		font-weight: bold;
		color: #FF5C00;
	}
	
	.tCount {
		font-size: 26rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #999999;
	}
	
	.it {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #666666;
	}
	
	.it2 {
		font-size: 26rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #000000;
	}
	
	.ma {
		width: 167rpx;
		height: 167rpx;
		margin-bottom: 9rpx;
	
		image {
			width: 100%;
			height: 100%;
		}
	}
	
	.btn-box {
		display: flex;
		flex-direction: row-reverse;
		position: fixed;
		bottom: 0;
		width: 100%;
		box-sizing: border-box;
	}
	
	.quxiao {
		padding: 8rpx 30rpx;
		border: 2rpx solid #666666;
		border-radius: 30rpx;
		margin-right: 25rpx;
	}
	
	.zhifu {
		padding: 8rpx 30rpx;
		border-radius: 30rpx;
		margin-right: 25rpx;
		color: #00D2E1;
		border: 2rpx solid #00D2E1;
	}
	
	.shanchu {
		padding: 8rpx 30rpx;
		border: 2rpx solid #666666;
		border-radius: 30rpx;
		margin-right: 25rpx;
	}
</style>